/*
 *
 *  ------------------------------------------------------------------
 *  Copyright © 2017 Hangzhou DtDream Technology Co.,Lt d. All rights reserved.
 *  ------------------------------------------------------------------
 *        Product:  EMR
 *    Module Name: NEZHA
 *   Date Created: 17-10-23 下午4:22
 *    Description:
 *  ------------------------------------------------------------------
 *  Modification History
 *  DATE            Name           Description
 *  ------------------------------------------------------------------
 *  2017-10-23      NEZHA EMR
 *  ------------------------------------------------------------------
 * /
 */
package org.xukai.remoting.sdk.web.api.serde;

import com.dtdream.emr.common.codec.JacksonCodec;
import okhttp3.MediaType;
import okhttp3.RequestBody;

import java.io.IOException;
import java.util.Map;

/**
 * Created by yangrs on 17-8-21.
 */
public class CreatePartitionSerDe extends HttpSerDe<Void> {

    private Map<String, String> partition;

    public CreatePartitionSerDe(Map<String, String> partition) {
        super(Void.class);
        this.partition = partition;
    }

    @Override
    public RequestBody serialize() throws IOException {
        return RequestBody.create(MediaType.parse("application/json"), JacksonCodec.serialize(partition));
    }
}
